﻿@page
@{ Layout = "_Layout"; }

<template>
    <div style="padding:0 11px;">
        <div>
            <el-form :inline="true" :size="euiSize">
                <el-form-item label="关键字">
                    <el-input v-model="form.keywords" placeholder="组织、用户名、姓名" prefix-icon="el-icon-search" clearable></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button :size="euiSize" icon="el-icon-search" type="primary" v-on:click="btnUserSearchClick">查 询</el-button>
                    <el-button :size="euiSize" plain type="primary" v-on:click="btnUserArrange" icon="el-icon-plus">安排考生</el-button>
                    <el-button :size="euiSize" plain type="primary" v-on:click="btnUserUpdateDatetime" icon="el-icon-date">修改考试时间</el-button>
                    <el-button :size="euiSize" plain type="primary" v-on:click="btnUserUpdateExamTimes(1)" icon="el-icon-plus">考试次数</el-button>
                    <el-button :size="euiSize" plain type="warning" v-on:click="btnUserUpdateExamTimes(0)" icon="el-icon-minus">考试次数</el-button>
                    <el-button :size="euiSize" type="danger" plain v-on:click="btnUserRemove" icon="el-icon-delete">移出考生</el-button>
                    <el-button :size="euiSize" plain type="primary" icon="el-icon-download" v-on:click="btnUserExportClick">
                        导 出
                    </el-button>
                </el-form-item>
            </el-form>
        </div>
        <div>
            <el-table ref="userTable" :data="userList" :size="euiSize" v-on:selection-change="userHandleSelectionChange"
                      style="width: 100%">
                <el-table-column type="selection" align="left"
                                 width="28">
                </el-table-column>
                <el-table-column label="#"
                                 type="index"
                                 width="60"
                                 align="left">
                    <template scope="scope">
                        <span>{{(form.pageIndex - 1) * form.pageSize + scope.$index + 1}}</span>
                    </template>
                </el-table-column>
                <el-table-column label="账号">
                    <template slot-scope="scope">
                        <el-link :underline="false" type="primary" v-on:click="btnViewClick(scope.row.user.id)">{{scope.row.user.userName}}</el-link>
                    </template>
                </el-table-column>
                <el-table-column prop="user.displayName" label="姓名">
                </el-table-column>
                <el-table-column prop="user.organNames" label="组织" show-overflow-toolti>
                </el-table-column>
                <el-table-column label="考试次数" width="120">
                    <template slot-scope="scope">
                        {{ scope.row.user.examTimes }}/{{ scope.row.examTimes }}
                    </template>
                </el-table-column>
                <el-table-column label="考试时间" width="270" show-overflow-toolti>
                    <template slot-scope="scope">
                        {{ scope.row.examBeginDateTime }}/{{ scope.row.examEndDateTime }}
                    </template>
                </el-table-column>
                <el-table-column prop="user.maxScore" label="最高分" width="100">
                </el-table-column>
                <el-table-column width="120" align="right">
                    <template slot-scope="scope">
                        <el-button size="mini" type="danger" plain v-on:click.native="btnUserDelete(scope.row)" icon="el-icon-delete">移出考生</el-button>
                    </template>
                </el-table-column>
                @await Html.PartialAsync("_PartialTableEmpty")
            </el-table>

            <div style="text-align: center; margin-top: 10px;">
                <el-pagination v-on:current-change="userHandleCurrentChange" background
                               :current-page="form.pageIndex"
                               :page-size="form.pageSize"
                               layout="total, prev, pager, next"
                               :total="userTotal">
                </el-pagination>
            </div>
        </div>
    </div>
</template>
<template>
    <el-dialog title="修改考试时间" :visible.sync="userUpdateDateTimeDialogVisible">
        <el-form ref="userUpdateDateTimeForm" :model="userUpdateDateTimeForm" :inline="true">
            <el-form-item label="考试时间" prop="examBeginDateTime" :rules="{ required: true, message: '请选择考试开始时间' }">
                <el-date-picker v-model="userUpdateDateTimeForm.examBeginDateTime"
                                type="datetime"
                                placeholder="开始时间"
                                value-format="yyyy-MM-dd HH:mm:ss">
                </el-date-picker>
            </el-form-item>
            <el-form-item prop="examEndDateTime" :rules="{ required: true, message: '请选择考试截止时间' }">
                <el-date-picker v-model="userUpdateDateTimeForm.examEndDateTime"
                                type="datetime"
                                placeholder="截止时间"
                                value-format="yyyy-MM-dd HH:mm:ss">
                </el-date-picker>
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button icon="el-icon-check" type="primary" v-on:click="btnUserUpdateDatetimeSubmit">确 定</el-button>
            <el-button icon="el-icon-close" v-on:click="userUpdateDateTimeDialogVisible = false">取 消</el-button>
        </div>
    </el-dialog>
</template>
@section Scripts{
    <script src="/sitefiles/assets/js/admin/exam/examPaperManagerUser.js" type="text/javascript"></script>
}